Meg's Mirrors
zig
about
heads
tags
log
tree
search
Search
zig
test
cases
compile_errors
pointless discard.zig
pretty
plain
permalink
blame
history
•
18 lines
•
286 B
1
export fn foo() void {
2
var x: i32 = 1234;
3
x += 1;
4
_ = x;
5
}
6
export fn bar() void {
7
var b: u32 = 1;
8
_ = blk: {
9
const a = 1;
10
b = a;
11
break :blk a;
12
};
13
}
14
15
// error
16
//
17
// :4:9: error: pointless discard of local variable
18
// :3:5: note: used here